home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_06
/
v7n6034a.txt
< prev
next >
Wrap
Text File
|
1989-07-23
|
512b
|
20 lines
// CI.CXX: An example of the copy-initializer
// being used for initialization.
class ci {
int i;
public:
ci(int j) { i = j; }
// copy-initializer:
ci(ci & rv) {
puts("copy-initializer called");
i = rv.i; // copy in the rvalue
}
};
main() {
ci original(1);
ci copy1(original); // copy-initializer called.
ci copy2 = original; // here, too
}